package com.youhome.config;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.util.Base64Utils;

/**
 * Created by chen365 on 2018/09/11.
 */
public class Test {
    public static void main(String[] args) {
        BCryptPasswordEncoder bCryptPasswordEncoder =new BCryptPasswordEncoder();
        String encode = bCryptPasswordEncoder.encode("123456");
        System.err.println(encode);
        boolean matches = bCryptPasswordEncoder.matches("123456", encode);
        System.err.println("matches:"+matches);

        String  s ="eyJhbGciOiJIUzUxMiJ9." +
                "eyJzdWIiOiIxMzQwMTA4Njk2NiIsImNyZWF0ZWQiOjE1MzY2ODA3NDMzMzgsImV4cCI6MTUzNjY4MDc1M30." +
                "KehkO6TpHglP2hSFKT6idhaMkvy8rMdTchYfMJZe_yFZtSaGbEz-33UsE2Hko6cbdjizzH0xnYHaoqTVZhwJvw";

        String s1 = Base64Utils.encodeToString("eyJhbGciOiJIUzUxMiJ9".getBytes());
        System.err.println("s1"+s1);
    }
}
